Skip to content

Conversation

@dranikpg
Copy link
Contributor

@dranikpg dranikpg commented Oct 12, 2025

Whenever we do a bare @field:value query we copy the whole blocklist to a vector of docids. We'll throw most of them away - so copy only as much as is needed

@dranikpg dranikpg changed the title WIP feat(search): Probabilistic cutoffs fix(search): Result set cutoff Oct 17, 2025
@dranikpg dranikpg requested a review from BorysTheDev October 18, 2025 14:36
@dranikpg dranikpg marked this pull request as ready for review October 18, 2025 14:40
@dranikpg dranikpg requested a review from kostasrim November 12, 2025 10:27
Copy link
Contributor

@kostasrim kostasrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comment, lgtm

Comment on lines +96 to +103
size_t total = 0;
out.reserve(std::min(limit, range->size()));
for (auto it = range->begin(); it != range->end(); ++it) {
total++;
if (out.size() < limit)
out.push_back(*it);
}
return {std::move(out), total};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
size_t total = 0;
out.reserve(std::min(limit, range->size()));
for (auto it = range->begin(); it != range->end(); ++it) {
total++;
if (out.size() < limit)
out.push_back(*it);
}
return {std::move(out), total};
out.reserve(std::min(limit, range->size()));
for (auto it = range->begin(); it != range->end(); ++it) {
if (out.size() < limit)
out.push_back(*it);
}
return {std::move(out), range->size()};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants